// 引用网络请求中间件
import request from '../../utils/request.js';

const API_NAME = '/user'

/* 用户好友 */

export default {
	/* 同意好友申请 */
	agreenFriendApply(id) {
		return request({
			url: `${API_NAME}/userFriendApi/acceptApply/wx?ufriendId=${id}`,
			method: 'PUT',
		})
	},
	/* 申请添加好友 */
	applyAddFriend(data) {
		return request({
			url: `${API_NAME}/userFriendApi/apply`,
			method: 'POST',
			data
		})
	},
	/* 查询好友申请列表 */
	getFiendApplyList() {
		return request({
			url: `${API_NAME}/userFriendApi/apply/list`,
			method: 'GET',
		})
	},
	/* 关注用户 */
	payUserYes(id) {
		return request({
			url: `${API_NAME}/userFriendApi/attention?userId=${id}`,
			method: 'POST',
			data
		})
	},
	/* 取消关注 */
	payUserNo(id) {
		return request({
			url: `${API_NAME}/userFriendApi/attention?userId=${id}`,
			method: 'DELETE',
			data
		})
	},
	/* 我的关注列表 */
	myPayList() {
		return request({
			url: `${API_NAME}/userIdolApi/personal/idol/list`,
			method: 'GET',
		})
	},
	/* 拉黑好友 */
	blackFriendYes(id) {
		return request({
			url: `${API_NAME}/userFriendApi/blackList?ufriendId=${id}`,
			method: 'PUT',
		})
	},
	/* 取消拉黑好友 */
	blackFriendNo(id) {
		return request({
			url: `${API_NAME}/userFriendApi/blackList?ufriendId=${id}`,
			method: 'DELETE',
		})
	},
	/* 拉黑列表 */
	blackFriendList() {
		return request({
			url: "/user/userFriendApi/blackList",
			method: 'GET',
		})
	},
	/* 删除好友 */
	deleteFriend(id) {
		return request({
			url: `${API_NAME}/userFriendApi/delete?ufriendId=${id}`,
			method: 'DELETE',
		})
	},
	/* 关注我的列表 */
	payMyList() {
		return request({
			url: `${API_NAME}/userIdolApi/personal/fans/list`,
			method: 'GET',
		})
	},
	/* 查询好友列表 */
	findFriendList() {
		return request({
			url: `${API_NAME}/userFriendApi/friend/list`,
			method: 'GET',
		})
	},
	/* 拒绝好友申请 */
	refuseFriendApply(id) {
		return request({
			url: `${API_NAME}/userFriendApi/rejectApply/wx`,
			method: 'PUT',
		})
	},
	/* 修改备注 */
	changeBase(ufriendId, uremark) {
		return request({
			url: `${API_NAME}/userFriendApi/remark?ufriendId=${ufriendId}&uremark=${uremark}`,
			method: 'PUT',
		})
	}
}
